UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uuC83oj8GJGAno5v2EQEgLngj0qfJijfe8Ev4PvMGg0='
WHERE
key_id = 'a71336166f8247804d88aa606978313e260657224e859f71544161a49bb880df'
AND (
token = 'uuC83oj8GJGAno5v2EQEgLngj0qfJijfe8Ev4PvMGg0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)