UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uM27dmzW/RElyuoVrglvSc1nnfkSBKMRraEMmnWb87Y='
WHERE
key_id = '587a1675b192f4316b24430eecef90951ed5c37c3301cbd206acaf1837266ace'
AND (
token = 'uM27dmzW/RElyuoVrglvSc1nnfkSBKMRraEMmnWb87Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)