UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QxmkvOpqkU8d6dY/figgMyYwDse/yVCDJ5pyyk9H4VY='
WHERE
key_id = '51761c21951d4bee6f8e538dff5ecab112857048e6d524472327a9ad1021b3ae'
AND (
token = 'QxmkvOpqkU8d6dY/figgMyYwDse/yVCDJ5pyyk9H4VY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)