UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FQV3HSy/4eomtcWvcuiQY4R/wjSsSbH8/IzFtup+yJg=' 
WHERE 
  key_id = '12fae9da156423d79472bbcd35b6bc881a4ee8c95fe711b213388d1f5194da84' 
  AND (
    token = 'FQV3HSy/4eomtcWvcuiQY4R/wjSsSbH8/IzFtup+yJg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029