UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IJ7wpLgHWNX6xb2SsjTQz2b1alxnCcIzM8pZZ2I9JJc='
WHERE
key_id = '71b9ce40d9a77606bad405cde96c1bc4fa339c5e4c2b8c2d81449297eca269a4'
AND (
token = 'IJ7wpLgHWNX6xb2SsjTQz2b1alxnCcIzM8pZZ2I9JJc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)