UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OV65hI9zA0GTl3URwiOfG4d7lXAcNg/Z+yczxloFvAs='
WHERE
key_id = 'acbce221486d11cc4c456f022aedd7629ce40894980fb091645e9e7db1b4450e'
AND (
token = 'OV65hI9zA0GTl3URwiOfG4d7lXAcNg/Z+yczxloFvAs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)