UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eZQgNuY8cWp205X5933RwWBUvpv41NX9KGq7ZIIiyoc='
WHERE
key_id = '20d370164a3fbf8cdd536d80d29a75e48a1bf70c1d0c64db79c8ae42f2c89225'
AND (
token = 'eZQgNuY8cWp205X5933RwWBUvpv41NX9KGq7ZIIiyoc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)