UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'D5lIuyPGMiSqVxj5vtF8s6xVhyGbLyG10/PKK9iGO+w='
WHERE
key_id = '2185b5c5d59b07284d92863a654d276f31283a1b2e845d297c381d1a64accf2f'
AND (
token = 'D5lIuyPGMiSqVxj5vtF8s6xVhyGbLyG10/PKK9iGO+w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)