UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MIwy+BaJ2D0e/hbpXwETT9bwjkCxH9q7bfdVgN26J7Q='
WHERE
key_id = '26d87a7f4ba897f1710e584e26e6fb428ac927a85fa35550975f45c47f5e9224'
AND (
token = 'MIwy+BaJ2D0e/hbpXwETT9bwjkCxH9q7bfdVgN26J7Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)