UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IL123tj7tIBINJUEPd6fJU7ik6aa//vGsuK4RCZeEjg='
WHERE
key_id = 'c3c3413d53272f356d6293050ce22008ae7b465a812f816e32f74e112732f4de'
AND (
token = 'IL123tj7tIBINJUEPd6fJU7ik6aa//vGsuK4RCZeEjg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)