UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OXupqX+EEPGPYGophlUUUdsJaP1k4GN8gikBBytgTKI='
WHERE
key_id = '29aa4ed1261e78af8ee136806d0b1d0dcf9bad2dc81f7e1ff244f4ac4817de06'
AND (
token = 'OXupqX+EEPGPYGophlUUUdsJaP1k4GN8gikBBytgTKI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)