UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '37ScWBodf7ljSU7YVofVWw650Oto6QON9qI/zvL1d6Q='
WHERE
key_id = 'e336245b0bc94143b1d820865da406e8b9cfc6ea62737920d76fdca22a173e37'
AND (
token = '37ScWBodf7ljSU7YVofVWw650Oto6QON9qI/zvL1d6Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)