UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pHiujxNqQ2TtEmNoFn11mz2mdY+5GjJroJ4sSwWpPvU='
WHERE
key_id = 'fec0cebd69bb60dc6d6e48909befe0d9f2fa43902441caadaadcbc0b4c803a0c'
AND (
token = 'pHiujxNqQ2TtEmNoFn11mz2mdY+5GjJroJ4sSwWpPvU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)