UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Z2ANrR64XBq0R/JPmQWARmDofPYAr/72PkayCXcXRuA='
WHERE
key_id = 'e37cca1fcd819ca18c0e6e6c7116e5eceb2e5e4f748683e342e790ec51428b72'
AND (
token = 'Z2ANrR64XBq0R/JPmQWARmDofPYAr/72PkayCXcXRuA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)