UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GJGe8S2vuOQlgwfYa5Iga0Xb7XiCbDUej3vzbwIQ4Ss='
WHERE
key_id = '00cbfb5fb99ccb190bd88792f16099407ef00c756949d1556ae0792ff8763510'
AND (
token = 'GJGe8S2vuOQlgwfYa5Iga0Xb7XiCbDUej3vzbwIQ4Ss='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)