UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PybAyZ1OJwm1KpmFyrh6dgQDy/VTVdv6j//JIcvLvX8='
WHERE
key_id = '53c7df43e2c81bdc1d6699fe29124207729acc29df697e4fd0bce0e38bbb549a'
AND (
token = 'PybAyZ1OJwm1KpmFyrh6dgQDy/VTVdv6j//JIcvLvX8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)