UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Et4q9F6bltZcYAkwifINxvVx+lgiD/IsNQ997KLKjbI='
WHERE
key_id = '6ab0021d68f0ffc540ddecb5b58e741a0de248a29dc1acbbc8a4d7b2cf5c0f31'
AND (
token = 'Et4q9F6bltZcYAkwifINxvVx+lgiD/IsNQ997KLKjbI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)