UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'avXyeu8qyKkd9tdy2ZI+j5ooUrNN2PCYeiFAQuU7JxE='
WHERE
key_id = 'ce5fc731f7a29b881bc6d8310686722cb95e8ac66f40e6db8f75f60103a2b1b9'
AND (
token = 'avXyeu8qyKkd9tdy2ZI+j5ooUrNN2PCYeiFAQuU7JxE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)