UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'n7Ux7GCgGWBrUwz9DRBVhRFdbxAtxNxKXwcOIMPUW0k='
WHERE
key_id = 'be2411494429b7a37f6ce0ec4a700c6ee30d389d00387ac5156446b4403bce84'
AND (
token = 'n7Ux7GCgGWBrUwz9DRBVhRFdbxAtxNxKXwcOIMPUW0k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)