UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LRCzLxao7ySvYFUdKTrVsBZmN3mNtxdnjs7MNxV/hHo=' 
WHERE 
  key_id = 'f5e8ef32ee5b0f37d141403916dfa0b2fd9af4c73a36ebb553540f2118e91860' 
  AND (
    token = 'LRCzLxao7ySvYFUdKTrVsBZmN3mNtxdnjs7MNxV/hHo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032