UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iNz0SSHOcBBave3mXj4fStls6Pgua3HQccG/ipzBCi4='
WHERE
key_id = '2f95059ebd11724a8aeaf4d89f7bfaf926625fe070274b269d4e90dfd6f03389'
AND (
token = 'iNz0SSHOcBBave3mXj4fStls6Pgua3HQccG/ipzBCi4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)