UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NnYaoRFlha4FciI47dAVeJDsGpMfAX5kolAj7IDd/cE=' 
WHERE 
  key_id = 'c43e6fdaac037a305d9da8dc7c0c01c005e67118f604b0dbfff32b981ec3dca1' 
  AND (
    token = 'NnYaoRFlha4FciI47dAVeJDsGpMfAX5kolAj7IDd/cE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033