UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'unRNY7kqxCb6TdKbzSN4IKmNW+iDmb1X/SlzbXPDloc='
WHERE
key_id = '6bd12b90397d1d3649d7d2e5278c4bb04ae2c2fccd5dc7334b27de8812a7ce94'
AND (
token = 'unRNY7kqxCb6TdKbzSN4IKmNW+iDmb1X/SlzbXPDloc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)