UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '67qD7zQVDS6yeo5JdedR2sdJfeTqg75yIGY1QKhKSNY='
WHERE
key_id = 'a9711ba6b5bb9bd3992515de15fb4f942299c0d45a1c511f985635562afe3d31'
AND (
token = '67qD7zQVDS6yeo5JdedR2sdJfeTqg75yIGY1QKhKSNY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)