UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cMpR/qkrAIGdk7jXJ2b6y/8PwfwYJJo/4R1zDa4Avpo='
WHERE
key_id = 'c558f18cd4c3d4d42b00c379c1d2405a499d2d0399f4036df9e77b6fb8fd3b1a'
AND (
token = 'cMpR/qkrAIGdk7jXJ2b6y/8PwfwYJJo/4R1zDa4Avpo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)