UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mhW4z6e2E+N/RwrxHJm754+tY+U5nmUbQgJpj9xzccs='
WHERE
key_id = '7fb0dd9f3ae955b8f4d803d837574ba04eb74eba47ac3f10adce9889236e9de3'
AND (
token = 'mhW4z6e2E+N/RwrxHJm754+tY+U5nmUbQgJpj9xzccs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)