UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aha3TMF22Dd9zNEsAaDaWRZ8N3dVFVqR3fuZJuRj2mY='
WHERE
key_id = '1faf4a159f87f0af01f1979928addc44610bbe83397af7d040c8cb0b7351e8c0'
AND (
token = 'aha3TMF22Dd9zNEsAaDaWRZ8N3dVFVqR3fuZJuRj2mY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)