UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FcO7KJtklzhNPz1m7RVa9kZa+6/xfck05BP9//6YLFg=' 
WHERE 
  key_id = 'eb142d9c0e37f897f69edd2fa81e75f3a51604cc47002cdf20ad5a98a491dfda' 
  AND (
    token = 'FcO7KJtklzhNPz1m7RVa9kZa+6/xfck05BP9//6YLFg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035