UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/5Si/Wls15TQBylFBr7ZvAB9xi0iOAVI6LkQ+d3/Ex4=' 
WHERE 
  key_id = '8923505119a49da5a578574323065a67a798af67f0e2de93264e921ccf597226' 
  AND (
    token = '/5Si/Wls15TQBylFBr7ZvAB9xi0iOAVI6LkQ+d3/Ex4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032