UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'me4xYuRK3a2pWns6yXJDuyffi9kmymMvogdbxjkI3kc='
WHERE
key_id = '887f8497cf15c70f56dd799d0f0a3c8abaa74d100239778b967ab4ba63c8611f'
AND (
token = 'me4xYuRK3a2pWns6yXJDuyffi9kmymMvogdbxjkI3kc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)