UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Q70rZL9wWVugnaLeqyxGSa0A8V/3ymxu0gSBnQNmCF0='
WHERE
key_id = 'a9cc4a2e6c5826ffbce8b2990b951e9fb72b7081cffbb36b7ca7e51c4367a36a'
AND (
token = 'Q70rZL9wWVugnaLeqyxGSa0A8V/3ymxu0gSBnQNmCF0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)