UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'J2eUR6hjcVdtiU9zpjH2Fm/arxdAm7DHB1niqdCXJEE=' 
WHERE 
  key_id = '4db9b35e4229cf3e4f6230f8d613260a6e6e08910f00053a4be6159364cc55c7' 
  AND (
    token = 'J2eUR6hjcVdtiU9zpjH2Fm/arxdAm7DHB1niqdCXJEE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027